# Maintainer: Brandon Boese <brandonboese@protonmail.com>
pkgname=mediascanner2
pkgver=0.115
pkgrel=0
pkgdesc="Media scanner for Lomiri"
url="https://gitlab.com/ubports/development/core/mediascanner2.git"
arch="all"
license="GPL-3.0-only AND LGPL-3.0-only"
source="https://gitlab.com/ubports/development/core/mediascanner2/-/archive/$pkgver/mediascanner2-$pkgver.tar.gz
	0001-rename-msg-to-message.patch
	0002-point-qmlplugindump-to-qmlplugindump-qt5.patch
	0003-disable-coverage-report.patch
	"
makedepends="
	cmake
	dbus-cpp-dev
	gdk-pixbuf-dev
	glib-dev
	gmock
	gtest-dev
	gstreamer-dev
	gst-plugins-base-dev
	libapparmor-dev
	libexif-dev
	qt5-qtbase-dev
	qt5-qtdeclarative-dev
	samurai
	sqlite-dev
	taglib-dev
	udisks2-dev
	"
options="!check" # tests fail to find gmock

build() {
	cmake -B build -G Ninja \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=ON \
		-DCMAKE_BUILD_TYPE=None \
		-DENABLE_TESTS=OFF
	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
82399ba394f6d858374de26d722b932812eb4c519993f1f5262c7b7b59eb620b56d24938c00bff9ccd3ab1759be451d2b782e1ab32f8fe4254635431462d67db  mediascanner2-0.115.tar.gz
18da589b6ba8394d175ea55d94407ebbd54e0dda90137e0ec172706b766115e80b6140ab4556dad5fa27cdec3f80acedb29d5db150ef7d3ba37b178c48b902c1  0001-rename-msg-to-message.patch
afa4ab639e8e72b8964e5a2ede6cb69ae207f298e5aaf966e9d3152da7ae19c46123c7a938b2a5499703f34aee703b73a5ba45a89c5c4116b061d79e5984fabb  0002-point-qmlplugindump-to-qmlplugindump-qt5.patch
3bb35becaf1e38fee9db96fc3e9410a221d2db5e757cd8e4a52a87ba18ff8d259698beb5d742e07ed06ba99fe77cb66fd6d2bb102069719b291f848a2afbe947  0003-disable-coverage-report.patch
"
